-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new type PackedArray
#275
Conversation
The idea is to have a similar interface as the array class from |
Yes, I just read the first part, and it was not obvious that it was the sparse array, sorry. Skimming through it, there were no docs, so I made the wrong inference. |
No worries! We're happy you're interested and that you're looking at the code. |
Btw: what about just using |
The adjective 'sparse' never made sense, because when you'd have to decide whether the arrays were sparse or dense, they're clearly dense. Another way of explaining it is that the data structures for representing sparse matrices would clearly be inefficient for our use cases and in fact need much more memory. There's usually a connected subset of the array that is non-zero, and when you integrate long enough the this subset should even be simply connected. |
From your comment, I'd say that it is an optimized strategy for the sparse matrix representation (as there is not a single best strategy). I.e., your matrix has a relevant amount of default elements, and you could compress your representation by avoiding writing down all elements. However, names are relevant but not crucial. So, if packed sounds more appropriate, just keep that :) |
That's basically it, we first map the |
After looking into the sparse matrix Wikipedia article, I think we're doing a kind of band matrix (at least for |
I wrote 4 benchmarks with the |
In this way all necessary modifications are made uniformly (with late `zip` it's possible to forget the first/second `skip`/`rev`
This should be more efficient since Rust can calculate the final size and thus allocate only once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is now in a very good shape, I'm going to merge it into master
.
just for the sake of knowledge transfer: I think I understand the general idea (you're saving coordinates), but |
Hi Felix, do you mean |
@janw20: I believe @felixhekhorn wants a better description of what's going inside |
I improved the documentation and committed it in 6a711bb to |
No description provided.